home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS077A.dsk
/
FOURTH GRADE DEMO.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
4KB
|
143 lines
1 REM NOTE THAT THERE IS A SECTION FIVE OF THIS PROGRAM WHICH DOES NOT APPEAR ON THE MENU
2 REM THIS UNLISTED PORTION OF THE PROGRAM IS AT LINE 1200 ET SEQ. FOR USE BY PERSONS OTHER THAN THE AUTHOR THIS SECTION SHOULD BE MODIFIED
3 REM THE PORTION OF THE PROGRAM FOR ADDITION AND MULTIPLICATION OF FRACTIONS SHOULD HAVE MANY USES
5 DIM Y$(50)
10 REM EDUCATIONAL DEMO PROGRAM FOR ROY'S FOURTH GRADE WRITTEN MAY 1979 BY N.K. GOTHIE
15 TEXT : HOME
20 HOME : VTAB 6: PRINT "THIS PROGRAM WILL DO THE FOLLOWING:"
30 PRINT : PRINT "1. NAME PRINT"
35 PRINT "2. ANYTHING PRINT"
40 PRINT "3. ADD FRACTIONS"
50 PRINT "4. MULTIPLY FRACTIONS"
60 PRINT "5. ALPHABETICAL LIST"
90 PRINT : PRINT "ENTER THE NUMBER OF THE DESIRED PROTION": INPUT A
100 IF A = 1 GOTO 200
105 IF A = 2 GOTO 1100
110 IF A = 3 GOTO 400
120 IF A = 4 GOTO 600
130 IF A = 5 GOTO 800
140 IF A = 6 GOTO 1200
160 GOTO 20
200 HOME : VTAB 8: PRINT "THIS SECTION WILL PRINT YOUR NAME MANY TIMES VERY QUICKLY"
210 PRINT : PRINT "WHAT IS YOUR NAME"
220 INPUT N$
230 FOR N = 1 TO 100: PRINT N$ SPC( 1);
240 NEXT
250 FOR N = 1 TO 2000
260 NEXT N
270 FOR N = 1 TO 50
280 PRINT N$,
290 NEXT
300 FOR N = 1 TO 2000
310 NEXT N
320 FOR N = 1 TO 24
330 PRINT TAB( N)N$
340 NEXT
350 FOR N = 1 TO 2000
360 NEXT N
370 PRINT : PRINT "WOULD YOU LIKE ANOTHER? Y/N"
380 INPUT Q$
385 IF Q$ = "Y" GOTO 200
390 IF Q$ = "N" GOTO 20
400 HOME : VTAB 8: PRINT "FRACTION ADDITION"
405 GOSUB 410
406 GOTO 485
410 PRINT "ENTER FIRST NUMERATOR"
420 INPUT B
430 PRINT "ENTER FIRST DENOMINATOR"
440 INPUT C
450 PRINT "ENTER SECOND NUMERATOR"
460 INPUT D
470 PRINT "ENTER SECOND DENOMINATOR"
480 INPUT E
482 RETURN
485 GOSUB 520
486 GOSUB 490
487 GOTO 515
490 PRINT TAB( 10)B TAB( 20)D TAB( 30)Y
500 PRINT TAB( 10)"-" TAB( 15)"+" TAB( 20)"-" TAB( 25)"=" TAB( 29)T TAB( 30)"-"
510 PRINT TAB( 10)C TAB( 20)E TAB( 30)Z
512 RETURN
515 PRINT : PRINT "WOULD YOU LIKE ANOTHER? Y/N"
516 INPUT Q$
517 IF Q$ = "Y" THEN GOTO 400
518 IF Q$ = "N" THEN GOTO 20
520 Y = (B *E) +(C *D)
530 Z = C *E
535 T = 0
540 IF Y > = Z THEN T = Y/Z
545 T = INT(T)
550 Y = Y -(T *Z)
555 GOSUB 999
560 RETURN
600 HOME : VTAB 8: PRINT "MULTIPLY FRACTIONS"
610 GOSUB 410
620 Y = B *D:Z = C *E
630 GOSUB 535
640 PRINT TAB( 10)B TAB( 20)D TAB( 30)Y
642 PRINT TAB( 10)"-" TAB( 15)"*" TAB( 20)"-" TAB( 25)"=" TAB( 29)T TAB( 30)"-"
644 PRINT TAB( 10)C TAB( 20)E TAB( 30)Z
650 PRINT : PRINT "WOULLD YOU LIKE ANOTHER? Y/N"
660 INPUT Q$
670 IF Q$ = "Y" GOTO 600
680 IF Q$ = "N" GOTO 20
800 HOME : VTAB 7: PRINT "ALPHABETICAL LIST OF WORDS"
806 N = 0
807 N = N +1
810 PRINT : PRINT "ENTER WORD NUMBER"N
815 PRINT "IF NO MORE WORDS ENTER 'A'"
820 INPUT Y$(N)
830 IF Y$(N) = "A" GOTO 850
840 GOTO 807
850 REM BEGIN SORT
855 F = 0:J = 1
860 IF Y$(J) < = Y$(J +1) GOTO 900
870 X$ = Y$(J +1)
875 Y$(J +1) = Y$(J)
880 Y$(J) = X$
890 F = 1
900 J = J +1: IF J < = N -1 GOTO 860
910 IF F = 1 GOTO 855
920 FOR J = 2 TO N: PRINT TAB( 16)Y$(J): NEXT
930 PRINT : PRINT "DO YOU WISH ANOTHER? Y/N": INPUT Q$
940 IF Q$ = "Y" GOTO 806
950 IF Q$ = "N" GOTO 20
999 R = 0
1000 FOR S = Y TO 1 STEP -1
1005 IF R = 2 GOTO 1030
1010 IF Y/S = INT(Y/S) GOTO 1050
1020 NEXT S
1030 RETURN
1050 IF Z/S = INT(Z/S) GOTO 1060
1055 GOTO 1020
1060 Y = Y/S:Z = Z/S:S = 0:R = R +1
1080 GOTO 1000
1100 HOME : VTAB 7: PRINT "THIS SECTION ALLOWS THE PRINTING OF ANY MESSAGE ANY NUMBER OF TIMES"
1110 PRINT : PRINT "ENTER THE MESSAGE": INPUT L$
1120 PRINT : PRINT "ENTER THE NUMBER OF TIMES YOU WISH THE MESSAGE PRINTED": INPUT L
1125 PRINT : PRINT "ENTER THE SPEED": INPUT S
1126 IF S >255 THEN S = 255
1127 SPEED= S
1130 FOR M = 1 TO L
1140 PRINT M; SPC( 1);L$
1150 NEXT
1155 SPEED= 255
1160 PRINT : PRINT "WOULD YOU LIKE ANOTHER? Y/N"
1170 INPUT Q$
1180 IF Q$ = "Y" GOTO 1100
1190 IF Q$ = "N" GOTO 20
1200 HOME : VTAB 8: PRINT "SPECIAL COMPUTER ADDING"
1210 PRINT : PRINT "WHAT IS YOUR NAME": INPUT N$
1220 PRINT : PRINT "HOW MUCH IS 2 PLUS 2" SPC( 1)N$: INPUT L
1230 IF N$ = "MR. GOTHIE" GOTO 1300
1235 IF N$ = "NELSON" GOTO 1300
1245 PRINT : PRINT "NO, I'M SORRY" SPC( 1)N$
1247 IF L = 22 GOTO 1280
1250 PRINT "2 PLUS 2 ARE 22"
1260 GOTO 1290
1280 PRINT "2 PLUS 2 ARE 4"
1290 PRINT : PRINT "WOULD YOU LIKE TO TRY AGAIN? Y/N"
1291 INPUT V$: IF V$ = "Y" GOTO 1200
1292 IF V$ = "N" GOTO 20
1300 PRINT : PRINT "THAT'S RIGHT, MR. GOTHIE IS ALWAYS RIGHT"
1310 GOTO 1290